using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Decision.BusinessLayer.DataLayer;

namespace Decision.BusinessLayer
{
    public class ECT_GROUP_LVLFactory
    {

        #region data Members

        ECT_GROUP_LVLSql _dataObject = null;

        #endregion

        #region Constructor

        public ECT_GROUP_LVLFactory()
        {
            _dataObject = new ECT_GROUP_LVLSql();
        }

        #endregion


        #region Public Methods

        /// <summary>
        /// Insert new ECT_GROUP_LVL
        /// </summary>
        /// <param name="businessObject">ECT_GROUP_LVL object</param>
        /// <returns>true for successfully saved</returns>
        public bool Insert(ECT_GROUP_LVL businessObject)
        {

            return _dataObject.Insert(businessObject);

        }

        /// <summary>
        /// Update existing ECT_GROUP_LVL
        /// </summary>
        /// <param name="businessObject">ECT_GROUP_LVL object</param>
        /// <returns>true for successfully saved</returns>
        public bool Update(ECT_GROUP_LVL businessObject)
        {

            return _dataObject.Update(businessObject);
        }

        /// <summary>
        /// get ECT_GROUP_LVL by primary key.
        /// </summary>
        /// <param name="keys">primary key</param>
        /// <returns>Student</returns>
        public ECT_GROUP_LVL GetByPrimaryKey(ECT_GROUP_LVLKeys keys)
        {
            return _dataObject.SelectByPrimaryKey(keys); 
        }

        /// <summary>
        /// get list of all ECT_GROUP_LVLs
        /// </summary>
        /// <returns>list</returns>
        public List<ECT_GROUP_LVL> GetAll()
        {
            return _dataObject.SelectAll(); 
        }

        /// <summary>
        /// get list of ECT_GROUP_LVL by field
        /// </summary>
        /// <param name="fieldName">field name</param>
        /// <param name="value">value</param>
        /// <returns>list</returns>
        public List<ECT_GROUP_LVL> GetAllBy(ECT_GROUP_LVL.ECT_GROUP_LVLFields fieldName, object value)
        {
            return _dataObject.SelectByField(fieldName.ToString(), value);  
        }

        /// <summary>
        /// delete by primary key
        /// </summary>
        /// <param name="keys">primary key</param>
        /// <returns>true for succesfully deleted</returns>
        public bool Delete(ECT_GROUP_LVLKeys keys)
        {
            return _dataObject.Delete(keys); 
        }

        /// <summary>
        /// delete ECT_GROUP_LVL by field.
        /// </summary>
        /// <param name="fieldName">field name</param>
        /// <param name="value">value</param>
        /// <returns>true for successfully deleted</returns>
        public bool Delete(ECT_GROUP_LVL.ECT_GROUP_LVLFields fieldName, object value)
        {
            return _dataObject.DeleteByField(fieldName.ToString(), value); 
        }

        #endregion

    }
}
